<template>
	<view class="goods">
		<view class="goods_info">
			<view class="goods_img">
				<x-image :src="`${imageUrl}${orderInfo.picturePath}`"></x-image>
			</view>

			<view class="goods_data">
				<view class="goods_title x-text-multi" >
					{{ orderInfo.goodsNormName }}
				</view>
				<view v-if="orderInfo.unit && orderInfo.unit.length>0" class="goods-unit">单位:{{orderInfo.unit}}</view>
				
				<view class="goods_num">
					<!-- <text class="goods_price">￥{{ orderInfo.price }}</text> -->
					<price :value="orderInfo.price" style="color:red;" /> 
					 <!-- <x-price :value="orderInfo.goodsPrice" style="color:red;"></x-price> -->
					<view>x{{orderInfo.quantity}}</view>

				</view>
			</view>

		</view>
	</view>

</template>

<script>
	import XImage from '@/components/image/xImage.vue'
	
	export default {
		// mixins: [ThemeMixin],
		components: {
			XImage,
		},
		props: {
			orderInfo: {
				type: Object,
				default: null,
			},
			type: {
				type: Number,
				default: 0, //直接购买下单为0， 大转盘中间实物订单1， 扫码实物订单2， 积分兑换订单3， 首单礼4， 生日订订单5
			},
		},

		mounted() {
			// this.orderInfo = this.data
		},
		data() {
			return {
				imageUrl: this.$Config.imageUrl,
				// orderInfo: null
				levels: [{
						code: 1,
						name: '一等奖'
					},
					{
						code: 2,
						name: '二等奖'
					},
					{
						code: 3,
						name: '三等奖'
					},
					{
						code: 4,
						name: '四等奖'
					},
					{
						code: 5,
						name: '五等奖'
					},
					{
						code: 6,
						name: '六等奖'
					}
				],
			}
		},

		methods: {
			onImgError(index) {}
		}
	}
</script>

<style lang="scss" scoped>
	@import '@/mixins/theme/xTheme.scss';
	$secondary-color: #999;
	.goods {
		height: 220rpx;
		display: flex;
		align-items: center;

		.goods_info {
			display: flex;
			align-items: center;
			height: 100%;
			padding: 20rpx;

			.goods_img {
				width: 180rpx;
				border-radius: 10rpx;
				height: 100%;
				margin-right: 20rpx;
				overflow: hidden;
			}

			.goods_img>image {
				width: 100%;
			}

			.goods_data {
				width: 510rpx;
				height: 100%;
				display: flex;
				justify-content: space-between;
				flex-direction: column;


				.goods_title {
					font-size: 30rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 2;
					padding-top: 10rpx;
					font-weight: bold;
				}
				
				.goods-unit {
					font-family: PingFang-SC;
					margin-top: 10rpx;
					font-weight: 400;
					font-size: 28rpx;
					color: $secondary-color;
				}


				.goods_num {
					display: flex;
					justify-content: space-between;
					align-items: center;

					.goods_price {
						font-size: 32rpx;
						font-weight: bold;
						color: #e51c23;
					}

					.goods_level {
						font-size: 32rpx;
						font-weight: medium;
					}
				}
			}
		}
	}
</style>